import http from "@/api";
import { CircleFriend } from "../interface/circleFriend";
import { ResPage } from "../interface";

export const addCircleFriend = (circleFriend: CircleFriend) => {
	return http.post<string>("/circleFriend/add", circleFriend);
};

export const getCircleFriendList = (pageNum: number = 1, pageSize: number = 10, wrapper?: Partial<CircleFriend>) => {
	return http.post<ResPage<CircleFriend>>(`/circleFriend/getList/${pageNum}/${pageSize}`, { wrapper });
};

export const deleteCircleFriend = (id: number) => {
	return http.delete<string>(`/circleFriend/remove/${id}`);
};

export const getCircleFriendDetail = (id: number) => {
	return http.get<CircleFriend>(`/circleFriend/getDetail/${id}`);
};

export const topCircleFriend = (id: number) => {
	return http.post<string>(`/circleFriend/top/${id}`);
};

export const cancelTopCircleFriend = (id: number) => {
	return http.post<string>(`/circleFriend/cancelTop/${id}`);
};

export const updateCircleFriendApi = (circleFriend: Partial<CircleFriend>) => {
	return http.post("/circleFriend/update", circleFriend);
};
